<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
  <!-- 我是注释, 哈哈哈 -->
  我是文本, 呵呵呵

  <div class="box">哈哈哈哈哈</div>
  <ul>
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
  </ul>
  
  <script>

    // var htmlEl = document.documentElement
    // var bodyEl = document.body
    // var headEl = document.head
    // var doctype = document.doctype
    // console.log(htmlEl, bodyEl, headEl, doctype)

    // 1.获取节点的导航
    var bodyEl = document.body
    // 1.1.获取body所有的子节点
    // console.log(bodyEl.childNodes)
    // 1.2.获取body的第一个子节点
    var bodyElFirstChild = bodyEl.firstChild
    // 1.3.获取body中的注释
    var bodyElCommentChild = bodyElFirstChild.nextSibling
    console.log(bodyElCommentChild)
    // 1.4.获取body的父节点
    var bodyParent = bodyEl.parentNode
    console.log(bodyParent)

  </script>

</body>
</html>